#########################################################

all_match_list=/public/home/xxf2019/20220915_gastric_multiple/config/Tumor_Normal_RNA.tsv

work_dir=/public/home/xxf2019/20220915_gastric_multiple/rna_batch1
config_path=/public/home/xxf2019/20220915_gastric_multiple/rna_batch1/config
script_path=/public/home/xxf2019/20220915_gastric_multiple/rna_batch1/scripts

now_sample_file=${config_path}/patients.csv

#########################################################

Rscript=~/miniconda3/envs/test_new/bin/Rscript

#########################################################
## 注释bamqc的质控信息
${Rscript} ${script_path}/MatchSample_BamQc.R \
--bam_qc_file ${work_dir}/results/Qc/Bam_MutipleQc/multiqc_report.tsv \
--base_line_file ${all_match_list} \
--out_path ${work_dir}/results/Qc/Bam_MutipleQc

## 表达矩阵看样本是否分层
${Rscript} ${script_path}/NormalTpm_Compare.R \
--expression_file ${work_dir}/results/RSEM/CombineTPM.tsv \
--base_line_file ${all_match_list} \
--out_path ${work_dir}/results/compareTpm

#########################################################
## 确认多少配对的样本
sample_list=`cat ${now_sample_file} | sed '1d' | awk -F, '{print $1}' | tr '\n' '|' | sed 's/|$//'`

## 手工检查样本组合情况
## 6个人的21个样本，Tumor和Normal都完整，共21+6个样本
## 2个人的6个样本，Tumor配对完整，共6个样本
## 16个人只返回了Normal样本，共16个样本
cat ${all_match_list} | grep -E ${sample_list}


